/**
 * 
 */
package fr.fermeManager.application.beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

import fr.fermeManager.library.model.beans.TypeTransaction;

/**
 * @author Mo
 *
 */
public class BeanTypeTransaction {
	
private TypeTransaction typeTransaction;
	
	private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
	
	public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

	/**
	 * @param idParent
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setIdParent(java.lang.Integer)
	 */
	public void setIdParent(Integer idParent) {
		Integer oldVal = typeTransaction.getIdParent();
		changeSupport.firePropertyChange("idParent", oldVal, idParent);
		typeTransaction.setIdParent(idParent);
	}

	/**
	 * @param id
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setId(int)
	 */
	public void setId(int id) {
		int oldVal = typeTransaction.getId();
		changeSupport.firePropertyChange("id", oldVal, id);
		typeTransaction.setId(id);
	}

	/**
	 * @param actif
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setActif(boolean)
	 */
	public void setActif(boolean actif) {
		boolean oldVal = typeTransaction.isActif();
		changeSupport.firePropertyChange("actif", oldVal, actif);
		typeTransaction.setActif(actif);
	}

	/**
	 * @param libelle
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setLibelle(java.lang.String)
	 */
	public void setLibelle(String libelle) {
		String oldVal = typeTransaction.getLibelle();
		changeSupport.firePropertyChange("libelle", oldVal, libelle);
		typeTransaction.setLibelle(libelle);
	}

	/**
	 * @param descritption
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setDescritption(java.lang.String)
	 */
	public void setDescritption(String descritption) {
		String oldVal = typeTransaction.getDescritption();
		changeSupport.firePropertyChange("descritption", oldVal, descritption);
		typeTransaction.setDescritption(descritption);
	}

	/**
	 * @param estSortie
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setEstSortie(boolean)
	 */
	public void setEstSortie(boolean estSortie) {
		boolean oldVal = typeTransaction.isEstSortie();
		changeSupport.firePropertyChange("estSortie", oldVal, estSortie);
		typeTransaction.setEstSortie(estSortie);
	}

	/**
	 * @param level
	 * @see fr.fermeManager.library.model.beans.TypeTransaction#setLevel(int)
	 */
	public void setLevel(int level) {
		int oldVal = typeTransaction.getLevel();
		changeSupport.firePropertyChange("level", oldVal, level);
		typeTransaction.setLevel(level);
	}
}
